function GameSelection() {
	
	this.showingGame = 3;
	this.numGames = 3;
	
	this.init = function () {
		gameState.currentMode = null;
		_("#divGameSelection").show();
	};
	
	this.processFrame = function() {
		var ssCosmicSquirrel = _("#ssCosmicSquirrel").hide();
		var ssDeathtrap = _("#ssDeathtrap").hide();
		var ssRefluxive = _("#ssRefluxive").hide();

		switch (this.showingGame) {
			case 1:
				ssCosmicSquirrel.show();
				document.getElementById('mgsDesc').innerHTML
					= 'In space, no one can hear a giant space squirrel buy it';
				break;
			case 2:
				ssDeathtrap.show();
				document.getElementById('mgsDesc').innerHTML
					= 'Hop on the tiles to escape the chasm without getting cooked';
				break;
			case 3:
				ssRefluxive.show();
				document.getElementById('mgsDesc').innerHTML
					= 'Who knows what they are, but they have to be kept moving';
				break;
		}		
	};
	
	
	
	this.keyUpHandler = function(e) {
		
		switch (e) {
			case KEY_LEFT:
				this.showingGame--;
				if (this.showingGame < 1) {
					this.showingGame = this.numGames;
				}
				break;
			case KEY_RIGHT:
				this.showingGame++;
				if (this.showingGame > this.numGames) {
					this.showingGame = 1;
				}
				break;
			case KEY_SPACE:
				gameState.currentGame.destroy();
				gameState.currentGame = null;
				gameState.reset();
				switch (this.showingGame) {
					case 1:
						startMiniGame('cosmicSquirrel');
						break;
					case 2:
						startMiniGame('deathtrap');
						break;
					case 3:
						startMiniGame('refluxive');
						break;
				}
				break;
		}
	}
} 
GameSelection.prototype = new MiniGame;
